const path = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const { car } = require('./src/mock')
module.exports = {
  mode: 'development',
  entry: './src/other.js',
  plugins: [
    new HtmlWebpackPlugin({
      template: './public/其他.html'
    })
  ],
  devServer: {
    onBeforeSetupMiddleware(devServer) {
      devServer.app.get('/car', (req, res) => {
        res.json({
          code: 200,
          data: car
        })
      })
    }
  }
}